function meta_analysis_act_sorted(proj_meta,cur_site,cell,pl_cells,shad,mean_fluo)

if max(pl_cells)~=cell
    pl=find(pl_cells>=cell,1,'first');
    if pl>1
        corr_cell=cell-pl_cells(pl-1);
    else
        corr_cell=cell;
    end
else
    pl=length(pl_cells);
    corr_cell=cell-pl_cells(pl-1);
end

ids=[-1:-1:-6 1:6];
res=[];
for tnd=1:size(proj_meta(cur_site).rd,2)
    act=proj_meta(cur_site).rd(pl,tnd).act(corr_cell,:);
    for fnd=1:6
        res(fnd,tnd)=mean(act(shad{tnd}==fnd));
    end
%     for fnd=1:12
%         res(fnd+6,tnd)=mean(act(pert{tnd}==ids(fnd)));
%     end
end

curYmax=max([max(res) max(mean_fluo(corr_cell,:))]);

col{1}=[0.8 0.8 0.8];
col{2}=[0.3 0.7 0.3];
col{3}=[1 0.5 0];
col{4}=[1 1 0.5];
col{5}=[0.9 0.2 0.2];
col{6}=[0 1 1];

figure(30);
clf
title(num2str(cell),'fontsize',15)
% set(gcf,'pos',[3508         754         328         239])
set(gcf,'pos',[4091        -398         328         239])
for gnd=1:6
    if gnd~=4
        hold on
        plot(res(gnd,:),'col',col{gnd},'linewidth',2)
        ylim([0.95 curYmax])
        xlim([1 size(proj_meta(cur_site).rd,2)])
        drawnow
    end
end
hold on
plot([1:size(proj_meta(cur_site).rd,2)],mean_fluo(cell,:),'*')